//
//  FMDBManager.h
//  Account
//
//  Created by wanmeizty on 2016/11/29.
//  Copyright © 2016年 wanmeizty. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "FMDB.h"

#import "AccountModel.h"

@interface FMDBManager : NSObject

@property(nonatomic,retain) FMDatabase *dataBase;//添加一个队列属性

@property (copy, nonatomic) NSString *tabelName;

+ (FMDBManager *)shareManager;

// 创建数据库
- (void)createFMDBDataBaseWithDbName:(NSString *)dbName;

// 创建表
- (void)createTableWithTableName:(NSString *)tableName;

// 插入
- (BOOL)insertWithAccountModel:(AccountModel *)accountModel;

//修改
-(BOOL)updateId:(NSInteger)index andAccountModel:(AccountModel *)accountModel;

//删除
-(BOOL)deleteWithId:(NSInteger)index;

//删除
-(BOOL)deleteTable;

//查询
- (NSArray *)query;

//条件查询
- (NSArray *)selectTableWithName:(NSString *)name;

//条件查询
- (double )getFeeFromTableWithName:(NSString *)name;

//计算各人结果
- (NSDictionary *)getEveryOneFeestringFromTable;
@end
